package class_wuziqi;

import java.io.ObjectInputStream;
import java.net.Socket;

import javax.swing.JTextArea;

public class Client_Receive implements Runnable{
	private Socket socket;
	private JTextArea jta;
	public Client_Receive(Socket socket,JTextArea jta){
		this.socket=socket;
		this.jta=jta;
	}
	@Override
	public void run() {
		try {
			while (true) {
				ObjectInputStream ois = new ObjectInputStream(socket.getInputStream());
				String o=(String)ois.readObject();
				jta.append(o);
			}
		} catch (Exception e) {
			// TODO: handle exception
		}
	}

}
